﻿using Jimmy.NinjiectDemo.Service;
using System.Collections.Generic;
using System.Web.Http;

namespace NinjectAutoInjectDemo.Controllers
{
    public class UserApiController : ApiController
    {
        private IUserService _userService { get; set; }
        private IPersonService _personService { get; set; }

        public UserApiController(IUserService userService, IPersonService personService)
        {
            _userService = userService;
            _personService = personService;
        }

        [HttpGet]
        public List<string> GetList()
        {
            // _userService = NinjectConfig.GetService<IUserService>();
            return _userService.List();
        }

        [HttpGet]
        public string GetPersonInfo()
        {
            var userName = "admin";
            return _personService.GetPersonInfo(userName);
        }
    }
}